/*class MyArray {
    public Object[] array = new Object[10];

    public Object getPos(int pos) {
        return this.array[pos];
    }
    public void setVal(int pos,Object val) {
        this.array[pos] = val;
    }
}*/
//这里用泛型对MyArray改进
class MyArray<T>{
    public Object[] array = new Object[10];

    public T getPos(int pos){
        return (T)this.array[pos];
    }
    public void setVal(int pos,T val){
        this.array[pos] = val;
    }
}

